<template>
	<layout :loading="loading" curPage="role" title="角色列表">

		<block slot="title">
			
			<authNav href="/pages/role/roleEdit" url="/admin/user/info" class="layui-btn layui-btn-sm">
				<i class="layui-icon layui-icon-add-1"></i>
				添加
			</authNav>
			
		</block>

		<div class="layui-form layui-border-box layui-table-view">

			<tableList :list="list" :canSelect="false">

				<block slot="head">
					<th>角色名称</th>
					<th class="autoWidth">权限描述</th>
					<th>操作</th>
				</block>

				<block slot="body">

					<tr v-for="( x , index) in list" :key="index">
						<td>{{x.name}}</td>
						<td>{{x.remark}}</td>
						<td>
							<authNav :href="'/pages/role/roleEdit?id=' + x.id" url="/admin/role/info" class="layui-btn layui-btn-xs">
								编辑
							</authNav>
							
							<authBtn :url="'/admin/role/delete?id='+x.id" confirm="delete" class="layui-btn layui-btn-xs">
								删除
							</authBtn>
						</td>
					</tr>

				</block>

			</tableList>
			
			<emptyTips :loading="true" :list="list"></emptyTips>

		</div>


	</layout>
</template>

<script>
	export default {
		data() {
			return {
				loading: true ,
				action: "/admin/role/list",
				list: []
			}
		},

		onShow() {
			this.kit.getList(this.action);
		},

		methods: {
			
		}
	}
</script>
